//
//  DownloadedCell.m
//  To Feel
//
//  Created by 孙嘉胤 on 16/7/22.
//  Copyright © 2016年 caoyu. All rights reserved.
//

#import "SJ_DownloadedCell.h"
#import "Masonry.h"
@implementation SJ_DownloadedCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
    
}

- (void)createView {
    
    self.fileNameLabel = [[UILabel alloc]init];
    self.sizeLabel = [[UILabel alloc]init];
    self.video_listImage = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"video_list"]];
    
    [self.contentView addSubview:self.fileNameLabel];
    [self.contentView addSubview:self.sizeLabel];
    [self.contentView addSubview:self.video_listImage];
    
}

- (void)layoutSubviews {
    
    [self.video_listImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.mas_left).with.offset(20);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(40, 35));
    }];
    [self.fileNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.video_listImage.mas_right).with.offset(30);
        make.centerY.equalTo(self.contentView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(200, 20));
    }];
    
    [self.sizeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.mas_right).with.offset(-15);
        make.bottom.equalTo(self.contentView.mas_bottom).with.offset(-8);
        make.size.mas_equalTo(CGSizeMake(80, 30));
        
    }];
    
    
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


-(void)setSessionModel:(ZFSessionModel *)sessionModel
{
    _sessionModel = sessionModel;
    self.fileNameLabel.text = sessionModel.fileName;
    self.sizeLabel.text = sessionModel.totalSize;
    
}

@end
